home *** CD-ROM | disk | FTP | other *** search
/ Giga Games 1 / Giga Games.iso / net / usenet / volume10 / gb3 / patch2i < prev   
Encoding:
Internet Message Format  |  1990-08-28  |  50.2 KB

  1. Path: uunet!zephyr.ens.tek.com!tekred!saab!billr
  2. From: billr@saab.CNA.TEK.COM (Bill Randle)
  3. Newsgroups: comp.sources.games
  4. Subject: v11i047:  gb3 - Galactic Bloodshed, an empire-like war game [Ver. 2.0], Patch2i
  5. Message-ID: <6234@tekred.CNA.TEK.COM>
  6. Date: 28 Aug 90 19:36:48 GMT
  7. Sender: news@tekred.CNA.TEK.COM
  8. Lines: 1626
  9. Approved: billr@saab.CNA.TEK.COM
  10.  
  11. Submitted-by: VANCLEEF@mps.ohio-state.edu
  12. Posting-number: Volume 11, Issue 47
  13. Archive-name: gb3/Patch2i
  14. Patch-To: gb3: Volume 10, Issue 1-14
  15.  
  16.  
  17.  
  18. #! /bin/sh
  19. # This is a shell archive.  Remove anything before this line, then unpack
  20. # it by saving it into a file and typing "sh file".  To overwrite existing
  21. # files, type "sh file -c".  You can also feed this as standard input via
  22. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  23. # will see the following message at the end:
  24. #        "End of archive 9 (of 9)."
  25. # Contents:  Docs/beginner.doc Docs/detonate.doc Docs/dissolve.doc
  26. #   Docs/dump.doc Docs/lasers.doc Docs/motto.doc Docs/production.doc
  27. #   Docs/read.doc Docs/repair.doc Docs/standby.doc Docs/stats.doc
  28. #   SETUP client/client.h server/capitol.c server/config.h
  29. #   server/dissolve.c server/files.h server/interface.h server/power.c
  30. #   server/races.h server/relation.c server/shipdata.h server/tech.c
  31. #   server/toggle.c
  32. # Wrapped by billr@saab on Tue Aug 28 08:55:01 1990
  33. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  34. if test -f 'Docs/beginner.doc' -a "${1}" != "-c" ; then 
  35.   echo shar: Renaming existing file \"'Docs/beginner.doc'\" to \"'Docs/beginner.doc.orig'\"
  36.   mv -f 'Docs/beginner.doc' 'Docs/beginner.doc.orig'
  37. fi
  38. echo shar: Extracting \"'Docs/beginner.doc'\" \(2900 characters\)
  39. sed "s/^X//" >'Docs/beginner.doc' <<'END_OF_FILE'
  40. X   If you are a beginner to Galactic Bloodshed (GB), no problem. The game
  41. Xmay seem a bit overwhelming at first, but so is everything at first :)
  42. XJust relax, get a cup of coffee, and enjoy. A typical GB game may last months
  43. Xand everything you do at first, even if you are out of touch for awhile,
  44. Xisn't totally critical! You can take off for the weekend, and have real life
  45. Xat the same time and come back to the game and have your race intact.
  46. X
  47. X  At any rate, what *is* GB anyway? Well, it's a wargame. But it is also a
  48. Xcampaign style war game. It is also a game of diplomacy, making and breaking
  49. Xalliances, back stabbing, and megalomania! All accessible via the net!
  50. X
  51. X  Basically, you start of with a race of people, and every race has it's own
  52. Xunique set of characteristics. What you want to do with this race is explore
  53. Xand maybe conquer the galaxy and be great big and famous and powerful...!
  54. XBUT, you can't do it alone, this is an important point ;)
  55. X
  56. X
  57. X  Speaking of points, what is the *point* of GB in the first place? 
  58. XWell, you want to *have fun*! Yes, that's the whole point of any game isn't 
  59. Xit? If you don't want to have fun, stop reading here and may your first born 
  60. Xhave the nose of camel and drink like one too :) In order to have fun you 
  61. Xmust realise at first - not all races are the same! In fact, every race is
  62. Xdifferent. Every race has advantages and disadvatages. During the first set 
  63. Xof updates, thing may seem uneven - but it's how you play the game in the 
  64. Xlong run which matters! Trust me on this.
  65. X
  66. X  Each turn in GB is called an 'update'. Updates are run at a schedule
  67. Xset by your game administrator (player #1 always!). During each update,
  68. Xyour population explores new sectors, the planets revolve about their
  69. Xprimaries (using Keppler's laws), ships are moved, production of resources,
  70. Xfuel, etc are made. In between updates you can order your ships, move
  71. Xyour people about on planets, attack enemy ships and planets, design your
  72. Xships etc...
  73. X
  74. X  What you want to do at first, is gather 50 resources, and then build a
  75. Xfactory. A factory is essential to the game. These things build ships!
  76. XYou build a factory, then tell it what kind of ship design you want to
  77. Xmake. The available ship designs are based on your technology which grows
  78. Xeach update. It takes a factory time to be ready to build it's ship design.
  79. XOnce the factory is ready, you can build ships there!
  80. X
  81. X  Next thing you want to do is explore the galaxy. Other planets in your
  82. Xhome star system should always be examined first. You might want to start
  83. Xcolonies on these. If you find a planet which you think your race can live
  84. Xon, land there and colonize!
  85. X
  86. X  As the game goes on, you will definitely run into other races. Talk to them!
  87. XThey may be good allies in the end - or maybe horrid enemies. That's up to
  88. Xyou. There's a big universe out there! And remember to *have fun*!
  89. X
  90. X:)
  91. X
  92. XGarrett van Cleef
  93. X6-14-90
  94. X
  95. X
  96. X
  97. X
  98. END_OF_FILE
  99. if test 2900 -ne `wc -c <'Docs/beginner.doc'`; then
  100.     echo shar: \"'Docs/beginner.doc'\" unpacked with wrong size!
  101. fi
  102. # end of 'Docs/beginner.doc'
  103. if test -f 'Docs/detonate.doc' -a "${1}" != "-c" ; then 
  104.   echo shar: Renaming existing file \"'Docs/detonate.doc'\" to \"'Docs/detonate.doc.orig'\"
  105.   mv -f 'Docs/detonate.doc' 'Docs/detonate.doc.orig'
  106. fi
  107. echo shar: Extracting \"'Docs/detonate.doc'\" \(381 characters\)
  108. sed "s/^X//" >'Docs/detonate.doc' <<'END_OF_FILE'
  109. XDETONATE            Galactic Bloodshed        DETONATE
  110. X
  111. X
  112. XNAME
  113. X  detonate -- force a mine to explode
  114. X
  115. XSYNTAX
  116. X  detonate <mine>
  117. X
  118. XDESCRIPTION
  119. X  
  120. X  Normally, a mine is set to detonate at a prearranged trigger radius
  121. Xusing the 'order' command. However, players may find it useful to order
  122. Xtheir space mines to explode upon request, between updates. This
  123. Xcommand is used to do this.
  124. X
  125. XSEE ALSO
  126. X  order
  127. X
  128. END_OF_FILE
  129. if test 381 -ne `wc -c <'Docs/detonate.doc'`; then
  130.     echo shar: \"'Docs/detonate.doc'\" unpacked with wrong size!
  131. fi
  132. # end of 'Docs/detonate.doc'
  133. if test -f 'Docs/dissolve.doc' -a "${1}" != "-c" ; then 
  134.   echo shar: Renaming existing file \"'Docs/dissolve.doc'\" to \"'Docs/dissolve.doc.orig'\"
  135.   mv -f 'Docs/dissolve.doc' 'Docs/dissolve.doc.orig'
  136. fi
  137. echo shar: Extracting \"'Docs/dissolve.doc'\" \(487 characters\)
  138. sed "s/^X//" >'Docs/dissolve.doc' <<'END_OF_FILE'
  139. XDISSOLVE            Galactic Bloodshed            DISSOLVE
  140. X
  141. X
  142. XNAME
  143. X  dissolve -- resign your forces from play in the game.
  144. X
  145. XSYNTAX
  146. X  dissolve <password>
  147. X
  148. XDESCRIPTION
  149. X  
  150. X   A player can resign from the game by issuing a dissolve command. All ships,
  151. Xsectors, resources, destruct, etc. are permanently eliminated from the game.
  152. XDissolved players also do not appear on power reports.
  153. X
  154. X   You must specify your password to dissolve. Make sure you want to do this
  155. Xbefore using it, as all is immediately lost!
  156. X
  157. X
  158. X
  159. END_OF_FILE
  160. if test 487 -ne `wc -c <'Docs/dissolve.doc'`; then
  161.     echo shar: \"'Docs/dissolve.doc'\" unpacked with wrong size!
  162. fi
  163. # end of 'Docs/dissolve.doc'
  164. if test -f 'Docs/dump.doc' -a "${1}" != "-c" ; then 
  165.   echo shar: Renaming existing file \"'Docs/dump.doc'\" to \"'Docs/dump.doc.orig'\"
  166.   mv -f 'Docs/dump.doc' 'Docs/dump.doc.orig'
  167. fi
  168. echo shar: Extracting \"'Docs/dump.doc'\" \(328 characters\)
  169. sed "s/^X//" >'Docs/dump.doc' <<'END_OF_FILE'
  170. XDUMP            Galactic Bloodshed            DUMP
  171. X
  172. X
  173. XNAME
  174. X  [10] dump -- give another player your expl,oration data
  175. X
  176. XSYNTAX
  177. X  dump <player>
  178. X
  179. XDESCRIPTION
  180. X  
  181. X   This allows a player to give another player (usually a trusted
  182. Xally) all of your exploration data. This information is permanently
  183. Xrecorded in the receiving player's exploration list.
  184. X
  185. X
  186. X
  187. END_OF_FILE
  188. if test 328 -ne `wc -c <'Docs/dump.doc'`; then
  189.     echo shar: \"'Docs/dump.doc'\" unpacked with wrong size!
  190. fi
  191. # end of 'Docs/dump.doc'
  192. if test -f 'Docs/lasers.doc' -a "${1}" != "-c" ; then 
  193.   echo shar: Renaming existing file \"'Docs/lasers.doc'\" to \"'Docs/lasers.doc.orig'\"
  194.   mv -f 'Docs/lasers.doc' 'Docs/lasers.doc.orig'
  195. fi
  196. echo shar: Extracting \"'Docs/lasers.doc'\" \(1472 characters\)
  197. sed "s/^X//" >'Docs/lasers.doc' <<'END_OF_FILE'
  198. XLASERS            Galactic Bloodshed            LASERS
  199. X
  200. X
  201. XCONCEPT
  202. X  lasers -- ships may mount combat lasers for use in battle.
  203. X
  204. XDESCRIPTION
  205. X  
  206. X   Some ships may be permitted to mount combat lasers at time
  207. Xof construction. Ships require a minimum technology of 100.
  208. XA ship which has a laser mounted may optionally
  209. Xuse these for firing instead of the normal guns. Unlike guns,
  210. Xlasers use fuel instead of destruct to attack with. Two points
  211. Xof fuel is equivalent to 1 gun. The player must also have a
  212. Xcrystal mounted to use the fuel for attacking.
  213. X
  214. X   There is no limit to the amount of fuel that may used in
  215. Xan attack. However, there is a technological stability limit,
  216. Xbeyond which crystal damage may result, or even an explosion.
  217. X
  218. XShip explosion is determined by the formula:
  219. X    Explosion if rand(0, strength) > ship tech/2.
  220. X
  221. XA 100 technology ship may fire up to 50 strength points safely, a
  222. X200 tech ship 100, etc. Pushing it beyond this limit may result
  223. Xin a matter/anti-matter explosion!
  224. X
  225. XCrystals may damage before they explode a ship. The chances of
  226. Xdamage (and hence an automatic dismount and loss of the crystal)
  227. Xis determined by
  228. X    Damaged if rand(0, strength) > ship tech/4.
  229. X
  230. XA ship will only fire lasers if told to do so. This is done using
  231. Xthe order command 'order <ship> laser on <default strength>'.
  232. XThe laser may be turned off with 'order <ship> laser off'. If the
  233. Xlaser is set on, then executing the 'fire' command uses lasers
  234. Xinstead of normal weapons.
  235. X
  236. XSEE ALSO
  237. X   fire, order
  238. X
  239. END_OF_FILE
  240. if test 1472 -ne `wc -c <'Docs/lasers.doc'`; then
  241.     echo shar: \"'Docs/lasers.doc'\" unpacked with wrong size!
  242. fi
  243. # end of 'Docs/lasers.doc'
  244. if test -f 'Docs/motto.doc' -a "${1}" != "-c" ; then 
  245.   echo shar: Renaming existing file \"'Docs/motto.doc'\" to \"'Docs/motto.doc.orig'\"
  246.   mv -f 'Docs/motto.doc' 'Docs/motto.doc.orig'
  247. fi
  248. echo shar: Extracting \"'Docs/motto.doc'\" \(350 characters\)
  249. sed "s/^X//" >'Docs/motto.doc' <<'END_OF_FILE'
  250. XMOTTO            Galactic Bloodshed            MOTTO
  251. X
  252. X
  253. XNAME
  254. X  motto -- set a motto for an alliance block
  255. X
  256. XSYNTAX
  257. X  motto <motto>
  258. X
  259. XDESCRIPTION
  260. X  
  261. X   Players may give the alliance block they control a motto which
  262. Xwill show up on individual block reports. This is strictly for 
  263. Xentertainment/communications and has no effect on the play of the game.
  264. X
  265. XSEE ALSO
  266. X   blocks
  267. X
  268. END_OF_FILE
  269. if test 350 -ne `wc -c <'Docs/motto.doc'`; then
  270.     echo shar: \"'Docs/motto.doc'\" unpacked with wrong size!
  271. fi
  272. # end of 'Docs/motto.doc'
  273. if test -f 'Docs/production.doc' -a "${1}" != "-c" ; then 
  274.   echo shar: Renaming existing file \"'Docs/production.doc'\" to \"'Docs/production.doc.orig'\"
  275.   mv -f 'Docs/production.doc' 'Docs/production.doc.orig'
  276. fi
  277. echo shar: Extracting \"'Docs/production.doc'\" \(348 characters\)
  278. sed "s/^X//" >'Docs/production.doc' <<'END_OF_FILE'
  279. XPRODUCTION        Galactic Bloodshed        PRODUCTION
  280. X
  281. X
  282. XNAME
  283. X  production -- show latest planet production statistics
  284. X
  285. XSYNTAX
  286. X  production
  287. X
  288. XDESCRIPTION
  289. X  
  290. X   This command will show the number of resources, fuel, and
  291. Xdestruct that a planet production during the previous update.
  292. XYou must change scope to the planet for this command to work.
  293. X
  294. XSEE ALSO
  295. X    survey
  296. X
  297. END_OF_FILE
  298. if test 348 -ne `wc -c <'Docs/production.doc'`; then
  299.     echo shar: \"'Docs/production.doc'\" unpacked with wrong size!
  300. fi
  301. # end of 'Docs/production.doc'
  302. if test -f 'Docs/read.doc' -a "${1}" != "-c" ; then 
  303.   echo shar: Renaming existing file \"'Docs/read.doc'\" to \"'Docs/read.doc.orig'\"
  304.   mv -f 'Docs/read.doc' 'Docs/read.doc.orig'
  305. fi
  306. echo shar: Extracting \"'Docs/read.doc'\" \(314 characters\)
  307. sed "s/^X//" >'Docs/read.doc' <<'END_OF_FILE'
  308. XREAD            Galactic Bloodshed        READ
  309. X
  310. X
  311. XNAME
  312. X  [0] read -- read messages from other players and news
  313. XSYNTAX
  314. X      read <what>
  315. X
  316. XDESCRIPTION
  317. X
  318. X  Read allows the player to look over messages sent to him by the other
  319. Xusers in the game.  Players can also read the 'Galactic News' by doing
  320. X'read news'.
  321. X
  322. XSEE ALSO
  323. X  telegram
  324. X
  325. END_OF_FILE
  326. if test 314 -ne `wc -c <'Docs/read.doc'`; then
  327.     echo shar: \"'Docs/read.doc'\" unpacked with wrong size!
  328. fi
  329. # end of 'Docs/read.doc'
  330. if test -f 'Docs/repair.doc' -a "${1}" != "-c" ; then 
  331.   echo shar: Renaming existing file \"'Docs/repair.doc'\" to \"'Docs/repair.doc.orig'\"
  332.   mv -f 'Docs/repair.doc' 'Docs/repair.doc.orig'
  333. fi
  334. echo shar: Extracting \"'Docs/repair.doc'\" \(647 characters\)
  335. sed "s/^X//" >'Docs/repair.doc' <<'END_OF_FILE'
  336. XREPAIR            Galactic Bloodshed            REPAIR
  337. X
  338. X
  339. XNAME
  340. X  [0] repair -- repair a planet/sectors
  341. X
  342. XSYNTAX
  343. X    repair <xlow:xhi,ylow:yhi or x,y>
  344. X
  345. XDESCRIPTION
  346. X    Players can repair sectors which have wasted designations, due to 
  347. Xcombat or other effects. The player must change scope to the planet. If
  348. Xno arguments are given, all sectors will be repaired to the limit of available
  349. Xresources. A player must inhabit at least one sector and have 10 resources
  350. Xfor each sector repaired. If arguments are given, a rectangular area
  351. Xspecified by the player will be repaired. Note that only wasted sectors
  352. Xcan be repaired, and sectors inhabited by aliens may not be repaired.
  353. X
  354. X
  355. END_OF_FILE
  356. if test 647 -ne `wc -c <'Docs/repair.doc'`; then
  357.     echo shar: \"'Docs/repair.doc'\" unpacked with wrong size!
  358. fi
  359. # end of 'Docs/repair.doc'
  360. if test -f 'Docs/standby.doc' -a "${1}" != "-c" ; then 
  361.   echo shar: Renaming existing file \"'Docs/standby.doc'\" to \"'Docs/standby.doc.orig'\"
  362.   mv -f 'Docs/standby.doc' 'Docs/standby.doc.orig'
  363. fi
  364. echo shar: Extracting \"'Docs/standby.doc'\" \(326 characters\)
  365. sed "s/^X//" >'Docs/standby.doc' <<'END_OF_FILE'
  366. XSTANDBY            Galactic Bloodshed            STANDBY
  367. X
  368. X
  369. XNAME
  370. X  standby -- enter dormant mode
  371. X
  372. XSYNTAX
  373. X  standby
  374. X
  375. XDESCRIPTION
  376. X  
  377. X   A player may enter standby mode, which doesn't use up time allotments,
  378. Xbut severely restricts the commands he/she may use. While in standby
  379. Xmode, a player may only issue communications commands.
  380. X
  381. XSEE ALSO
  382. X    time
  383. END_OF_FILE
  384. if test 326 -ne `wc -c <'Docs/standby.doc'`; then
  385.     echo shar: \"'Docs/standby.doc'\" unpacked with wrong size!
  386. fi
  387. # end of 'Docs/standby.doc'
  388. if test -f 'Docs/stats.doc' -a "${1}" != "-c" ; then 
  389.   echo shar: Renaming existing file \"'Docs/stats.doc'\" to \"'Docs/stats.doc.orig'\"
  390.   mv -f 'Docs/stats.doc' 'Docs/stats.doc.orig'
  391. fi
  392. echo shar: Extracting \"'Docs/stats.doc'\" \(277 characters\)
  393. sed "s/^X//" >'Docs/stats.doc' <<'END_OF_FILE'
  394. XSTATS            Galactic Bloodshed        STATS
  395. X
  396. X
  397. XNAME
  398. X  [0] stats -- report ship characteristics
  399. XSYNTAX
  400. X      status <#shipnum or ship types>
  401. X
  402. XDESCRIPTION
  403. X  This command allows users to examine characteristics of their ships.  
  404. X
  405. X
  406. XSEE ALSO
  407. X  examine, ship, stock, tactical, scope, report
  408. X
  409. END_OF_FILE
  410. if test 277 -ne `wc -c <'Docs/stats.doc'`; then
  411.     echo shar: \"'Docs/stats.doc'\" unpacked with wrong size!
  412. fi
  413. # end of 'Docs/stats.doc'
  414. if test -f 'SETUP' -a "${1}" != "-c" ; then 
  415.   echo shar: Renaming existing file \"'SETUP'\" to \"'SETUP.orig'\"
  416.   mv -f 'SETUP' 'SETUP.orig'
  417. fi
  418. echo shar: Extracting \"'SETUP'\" \(2840 characters\)
  419. sed "s/^X//" >'SETUP' <<'END_OF_FILE'
  420. XFrom: vancleef@ohstpy.mps.ohio-state.edu
  421. XNewsgroups: alt.games.galactic-bloodshed
  422. XSubject: Compilation/Setup
  423. XDate: 2 Aug 90 21:21:14 GMT
  424. XLines: 56
  425. X
  426. XOK, several people have been requesting info on how to get GB set up, etc,
  427. Xand since I finally can get this new newsgroup, here we go.
  428. X
  429. XAll of the details on setting it up are in README1.3 - but here is a brief
  430. Xdescription.
  431. X
  432. XGB is divided into two parts, a 'server' which resides on the computer of
  433. Xthe person who is hosting the game. This person should be in charge of
  434. Xmaking sure everything is running smoothly, enrolling players, etc. 
  435. XThe server communicates with players over the network. It processes command
  436. Xlines and send information to the appropriate players. The game is
  437. Xdesigned to be accessible 24 hrs a day, via the internet.
  438. XEach player should have a copy of the 'client'. If you dont want to host
  439. Xa game you needn't get the server, just the client. The client talks with
  440. Xserver and draws maps when they are requested. The server sends coded
  441. Xinformation which tells the client how to draw the maps.
  442. X
  443. XThe server and client as well as game docs are posted at an ftp site.
  444. XYou can obtain them from 'scam.berkeley.edu' (128.32.138.0) using
  445. Xanonymous ftp in the directory tmp/GB. Jeff Wallace maintains the
  446. Xftp site and compresses the code every few days or so. Since I post
  447. Xmodification to it regularly, it's probably a good idea to examine the
  448. Xdates on the files, as changes are made almost daily, get the latest
  449. Xversion. The server is in the file GB_server.shar, client in GB_client.shar,
  450. Xand docs in GB_docs.shar.
  451. X
  452. XSetting up a client:
  453. X    obtain the GB_client.shar file and set up a client directory.
  454. X    Then do 'sh GB_client.shar' and your system will unpack the
  455. X    file. Then, do 'make' and your system should compile the
  456. X    program. Note, you may have to make modifications to the
  457. X    Makefile to get it to run on your system. See a local Unix
  458. X    guru for help if you don't understand it.
  459. X    
  460. X    You can then connect to your favorite GB game by doing
  461. X    'GB_client <host> <port>'. e.g. - GB_client pooh.caltech.edu 2010
  462. X    would get you to the caltech game (which is sorta dying now :)
  463. X
  464. XSetting up the server:
  465. X    Obtain GB_server.shar, and set up a directory called 'GB' (my
  466. X    suggestion). Then do 'sh GB_server.shar' and then 'make'.
  467. X    Once again you may have to modify the Makefile to get it to
  468. X    work on your system. The makee process will also produce other
  469. X    programs, these are described in README1.3 which comes along
  470. X    with the server.
  471. X
  472. XRemember, gb has come a long way and we are still working things out. Post
  473. X    suggestions here or e-mail to vancleef@pooh.caltech.edu or
  474. X    vancleef@ohstpy.mps.ohio-state.edu. You can also send to
  475. X    Robert Chansky (address in previous posting)
  476. X
  477. X"Let the space battles begin!" - Jeff Wallace
  478. X
  479. Xdisclaimer: *** THIS MAY BE INCOMPATIBLE WITH SYSTEM/V ***
  480. X
  481. X-Garrett
  482. X
  483. X
  484. END_OF_FILE
  485. if test 2840 -ne `wc -c <'SETUP'`; then
  486.     echo shar: \"'SETUP'\" unpacked with wrong size!
  487. fi
  488. # end of 'SETUP'
  489. if test -f 'client/client.h' -a "${1}" != "-c" ; then 
  490.   echo shar: Renaming existing file \"'client/client.h'\" to \"'client/client.h.orig'\"
  491.   mv -f 'client/client.h' 'client/client.h.orig'
  492. fi
  493. echo shar: Extracting \"'client/client.h'\" \(294 characters\)
  494. sed "s/^X//" >'client/client.h' <<'END_OF_FILE'
  495. X#define VERS "1.3.1  7/25/90"
  496. X
  497. X#ifndef TRUE
  498. X#define TRUE 1
  499. X#endif
  500. X
  501. X#ifndef FALSE
  502. X#define FALSE 0
  503. X#endif
  504. X
  505. X#define MAXSTRLEN 8192
  506. X#define HUGESTRLEN (2*MAXSTRLEN + 1)
  507. X#define SMALLSTR 31
  508. X
  509. Xtypedef char    string[MAXSTRLEN];
  510. Xtypedef char    hugestr[HUGESTRLEN];
  511. Xtypedef char    smallstr[SMALLSTR];
  512. END_OF_FILE
  513. if test 294 -ne `wc -c <'client/client.h'`; then
  514.     echo shar: \"'client/client.h'\" unpacked with wrong size!
  515. fi
  516. # end of 'client/client.h'
  517. if test -f 'server/capitol.c' -a "${1}" != "-c" ; then 
  518.   echo shar: Renaming existing file \"'server/capitol.c'\" to \"'server/capitol.c.orig'\"
  519.   mv -f 'server/capitol.c' 'server/capitol.c.orig'
  520. fi
  521. echo shar: Extracting \"'server/capitol.c'\" \(1969 characters\)
  522. sed "s/^X//" >'server/capitol.c' <<'END_OF_FILE'
  523. X/*
  524. X * Galactic Bloodshed, copyright (c) 1989 by Robert P. Chansky, 
  525. X * smq@ucscb.ucsc.edu, mods by people in GB_copyright.h.
  526. X * Restrictions in GB_copyright.h.
  527. X *
  528. X * capitol.c -- designate a capitol
  529. X */
  530. X
  531. X#include "GB_copyright.h"
  532. X#define EXTERN extern
  533. X#include "vars.h"
  534. X#include "ships.h"
  535. X#include "races.h"
  536. X#include "buffers.h"
  537. X#include <signal.h>
  538. X
  539. Xint capitol_racedata;
  540. X
  541. Xcapitol(Playernum,APcount, argn,args)
  542. Xint Playernum;
  543. Xint APcount;
  544. Xint argn;
  545. Xchar args[MAXARGS][COMMANDSIZE];
  546. X{
  547. Xint shipno,stat;
  548. Xint shdata;
  549. Xshiptype *s;
  550. Xracetype *Race;
  551. X
  552. Xopenracedata(&capitol_racedata);
  553. Xgetrace(capitol_racedata, &Race, Playernum);
  554. Xclose_file(capitol_racedata);
  555. X
  556. X  if (argn!=2) {
  557. X     shipno = Race->Gov_ship;
  558. X  } else {
  559. X
  560. X     shipno = atoi(args[1]+(args[1][0]=='#'));
  561. X
  562. X     if (Dir[Playernum-1].level==LEVEL_UNIV) {
  563. X     if (!enufAP(Playernum,Sdata.AP[Playernum-1],APcount)) {
  564. X         free(Race);
  565. X         return;
  566. X        }
  567. X     } else {
  568. X     if (!enufAP(Playernum,Stars[Dir[Playernum-1].snum]->AP[Playernum-1],APcount)) {
  569. X         free(Race);
  570. X         return;
  571. X        }
  572. X        }
  573. X  }
  574. X
  575. Xif(shipno <= 0) {
  576. X    notify(Playernum, "Change the capitol to be what ship?\n");
  577. X    free(Race);
  578. X    return;
  579. X    }
  580. X
  581. X  openshdata(&shdata);
  582. X  stat = getship(shdata, &s, shipno);
  583. X  close_file(shdata);
  584. X
  585. X  if (argn==2) {
  586. X    if (!stat || testship(Playernum,s, shipno)) {
  587. X    free(Race);
  588. X    free(s);
  589. X    return;
  590. X    }
  591. X
  592. X    if (s->type!=OTYPE_GOV) {
  593. X    sprintf(buf,"That ship is not a %s.\n",Shipnames[OTYPE_GOV]);
  594. X    notify(Playernum, buf);
  595. X    free(Race);
  596. X    free(s);
  597. X    return;
  598. X    }
  599. X
  600. X    if (Dir[Playernum-1].level==LEVEL_UNIV)
  601. X      deductAPs(Playernum, APcount, 0, 1);
  602. X    else
  603. X      deductAPs(Playernum, APcount, Dir[Playernum-1].snum, 0);
  604. X
  605. X        Race->Gov_ship = shipno;
  606. X    openracedata(&capitol_racedata);
  607. X        putrace(capitol_racedata, Race);
  608. X    close_file(capitol_racedata);
  609. X
  610. X  }
  611. X  sprintf(buf,"Efficiency of governmental center: %.0f%%.\n", 
  612. X    ((float)s->popn/Max_crew(s)) *
  613. X    (100 - (float)s->damage) );
  614. X  notify(Playernum, buf);
  615. X  free(Race);
  616. X  free(s);
  617. X
  618. X}
  619. END_OF_FILE
  620. if test 1969 -ne `wc -c <'server/capitol.c'`; then
  621.     echo shar: \"'server/capitol.c'\" unpacked with wrong size!
  622. fi
  623. # end of 'server/capitol.c'
  624. if test -f 'server/config.h' -a "${1}" != "-c" ; then 
  625.   echo shar: Renaming existing file \"'server/config.h'\" to \"'server/config.h.orig'\"
  626.   mv -f 'server/config.h' 'server/config.h.orig'
  627. fi
  628. echo shar: Extracting \"'server/config.h'\" \(760 characters\)
  629. sed "s/^X//" >'server/config.h' <<'END_OF_FILE'
  630. X#include "files.h"    /* for PATH() definition */
  631. X#define VERS "2.2.3 8/23/90"
  632. X
  633. X#ifndef GB_HOST
  634. X#define GB_HOST "pooh.caltech.edu"
  635. X#endif
  636. X
  637. X#ifndef GB_PORT
  638. X#define GB_PORT 2010
  639. X#endif
  640. X
  641. X
  642. X#define COMMAND_TIME_MSEC 250    /* time slice length in milliseconds */
  643. X#define COMMANDS_PER_TIME 1    /* commands per time slice after burst */
  644. X#define COMMAND_BURST_SIZE 250    /* commands allowed per user in a burst */
  645. X#define DISCONNECT_TIME        7200    /* maximum idle time */
  646. X#define MAX_OUTPUT 32768
  647. X#define DAEMON_PASSWORD "put_your_update_password_here"
  648. X
  649. X#define QUIT_COMMAND "quit"
  650. X#define WHO_COMMAND "who"
  651. X#define HELP_COMMAND "help"
  652. X
  653. X/* put full pathnames in here as required */
  654. X#define WELCOME_FILE PATH(welcome.txt)
  655. X#define LEAVE_MESSAGE "\n*** Have a nice day :-) ***\n"
  656. END_OF_FILE
  657. if test 760 -ne `wc -c <'server/config.h'`; then
  658.     echo shar: \"'server/config.h'\" unpacked with wrong size!
  659. fi
  660. # end of 'server/config.h'
  661. if test -f 'server/dissolve.c' -a "${1}" != "-c" ; then 
  662.   echo shar: Renaming existing file \"'server/dissolve.c'\" to \"'server/dissolve.c.orig'\"
  663.   mv -f 'server/dissolve.c' 'server/dissolve.c.orig'
  664. fi
  665. echo shar: Extracting \"'server/dissolve.c'\" \(3661 characters\)
  666. sed "s/^X//" >'server/dissolve.c' <<'END_OF_FILE'
  667. X/*
  668. X * Galactic Bloodshed, copyright (c) 1989 by Robert P. Chansky,
  669. X * smq@ucscb.ucsc.edu, mods by people in GB_copyright.h.
  670. X * Restrictions in GB_copyright.h.
  671. X * dissolve.c -- commit suicide, nuke all ships and sectors;
  672. X * July 24th, 1989, John Deragon, cruz@cadman.nyu.edu
  673. X */
  674. X
  675. X#include "GB_copyright.h"
  676. X#define EXTERN extern
  677. X#include "vars.h"
  678. X#include "ships.h"
  679. X#include "races.h"
  680. X#include "doturn.h"
  681. X#include "power.h"
  682. X#include "buffers.h"
  683. X#include <math.h>
  684. X
  685. X
  686. Xdissolve(Playernum, argn, args)
  687. Xint Playernum;
  688. Xint argn;
  689. Xchar args[MAXARGS][COMMANDSIZE];
  690. X{
  691. X
  692. Xint shdata, pdata, racedata, stardata, sectdata, n_ships;
  693. Xint i, z, x, y, x2, y2, hix, hiy, lowx,lowy;
  694. Xboolean waste;
  695. Xshiptype *sp;
  696. Xracetype *Race;
  697. Xplanettype *pl;
  698. Xsectortype *s;
  699. Xchar nuke;
  700. Xchar buf[1024][100];
  701. Xchar password[100];
  702. X
  703. Xopenshdata(&shdata);
  704. Xn_ships = Numships(shdata);
  705. Xclose_file(shdata);
  706. X
  707. Xif (argn < 2) {
  708. X    sprintf(buf, "Self-Destruct sequence requires password.\n");
  709. X    notify(Playernum, buf);
  710. X    sprintf(buf, "Please use 'dissolve <your password> '<option> to initiate\n");
  711. X    notify(Playernum, buf);
  712. X    sprintf(buf, "self-destruct sequence.\n");
  713. X    notify(Playernum, buf);
  714. X    return;
  715. X   } else {
  716. X    sprintf(buf, "WARNING!! WARNING!! WARNING!!\n");
  717. X    notify(Playernum, buf);
  718. X    sprintf(buf, "-------------------------------\n");
  719. X    notify(Playernum, buf);
  720. X    sprintf(buf, "Entering self destruct sequence!\n");
  721. X    notify(Playernum, buf);
  722. X
  723. X
  724. X    sscanf(args[1], "%s", password);
  725. X
  726. X
  727. X    waste = 0;
  728. X    if(argn > 2) {
  729. X    sscanf(args[2], "%c", &nuke);
  730. X        if (nuke == 'w') 
  731. X           waste = 1;
  732. X    }
  733. X    
  734. X    i = Getracenum(password);
  735. X
  736. X        if (!i) {
  737. X       sprintf(buf, "Password mismatch, self-destruct not initiated!\n");
  738. X      notify(Playernum, buf);
  739. X     return;
  740. X    }    
  741. X
  742. Xopenshdata(&shdata);
  743. Xfor (i=1; i<=n_ships; i++) {
  744. X    getship(shdata,&sp, i);
  745. X    if (sp->owner == Playernum) {
  746. X        kill_ship(Playernum, sp);
  747. X        makeshipdead(i);
  748. X        sprintf(buf, "Ship #%d, self-destruct enabled\n",i);
  749. X        notify(Playernum, buf);
  750. X        putship(shdata, sp, i);
  751. X    }
  752. X    free(sp);
  753. X}
  754. Xclose_file(shdata);
  755. X
  756. X openstardata(&stardata);
  757. X getsdata(stardata,&Sdata);
  758. X openpdata(&pdata);
  759. X opensectdata(§data);
  760. Xfor (z=0; z<Sdata.numstars; z++) {
  761. X    free(Stars[z]); 
  762. X   getstar(stardata, &(Stars[z]), z);
  763. X    if (isset(Stars[z]->explored,Playernum)) {
  764. X        for (i=0; i<Stars[z]->numplanets; i++) {
  765. X           getplanet(pdata,&pl,Stars[z]->planetpos[i]);
  766. X
  767. X           if (pl->info[Playernum-1].explored
  768. X               && pl->info[Playernum-1].numsectsowned)  {
  769. X                      pl->info[Playernum-1].numsectsowned = 0;
  770. X            pl->info[Playernum-1].explored = 0;
  771. X            pl->info[Playernum-1].resource = 0;
  772. X            pl->info[Playernum-1].destruct = 0;
  773. X            pl->info[Playernum-1].fuel = 0;    
  774. X            pl->popn = 0; 
  775. X
  776. X        }
  777. X
  778. X             getsmap(sectdata,Smap,pl);
  779. X
  780. X
  781. X    lowx = 0;
  782. X    lowy = 0;
  783. X    hix = pl->Maxx-1;
  784. X    hiy = pl->Maxy-1;
  785. X    for (y2=lowy; y2<=hiy; y2++) {
  786. X         for (x2=lowx; x2<=hix; x2++) {
  787. X             s = &Sector(*pl,x2,y2);
  788. X        if (s->owner == Playernum) {
  789. X        s->owner = 0;
  790. X        s->popn = 0;
  791. X          if (waste)
  792. X            s->is_wasted = 1;
  793. X            }
  794. X          }
  795. X    }
  796. X            putsmap(sectdata,Smap,pl);
  797. X        putstar(stardata, Stars[z], z);
  798. X        putplanet(pdata,pl,Stars[z]->planetpos[i]);
  799. X        free(pl);
  800. X            }
  801. X     }
  802. X   }    
  803. Xclose_file(pdata);
  804. Xclose_file(stardata);
  805. Xclose_file(sectdata);
  806. X
  807. X    openracedata(&racedata);                                          
  808. X    getrace(racedata, &Race, Playernum);                              
  809. X    Race->dissolved = 1;
  810. X    putrace(racedata, Race);
  811. X    close_file(racedata);
  812. X
  813. X    for(i=1; i<=Numraces(); i++)
  814. X    if(i!=Playernum) {
  815. X        sprintf(buf, "%s [%d] has dissolved.\n", Race->name, Playernum);
  816. X        if(!notify(i, buf))
  817. X        push_message(TELEG_PLAYER_AUTO, i, buf, DECLARATION);
  818. X       }
  819. X        free(Race);
  820. X    }
  821. X}
  822. END_OF_FILE
  823. if test 3661 -ne `wc -c <'server/dissolve.c'`; then
  824.     echo shar: \"'server/dissolve.c'\" unpacked with wrong size!
  825. fi
  826. # end of 'server/dissolve.c'
  827. if test -f 'server/files.h' -a "${1}" != "-c" ; then 
  828.   echo shar: Renaming existing file \"'server/files.h'\" to \"'server/files.h.orig'\"
  829.   mv -f 'server/files.h' 'server/files.h.orig'
  830. fi
  831. echo shar: Extracting \"'server/files.h'\" \(1475 characters\)
  832. sed "s/^X//" >'server/files.h' <<'END_OF_FILE'
  833. X#ifndef _FILES_H_
  834. X#define _FILES_H_
  835. X/*
  836. X * Galactic Bloodshed, copyright (c) 1989 by Robert P. Chansky, 
  837. X * smq@ucscb.ucsc.edu, mods by people in GB.c, enroll.dat.
  838. X * Restrictions in GB.c.
  839. X */
  840. X
  841. X
  842. X#ifdef __STDC__
  843. X/*# define PATH(file)    "/Net/pooh/Users/Staff/vancleef/GB/" #file */
  844. X#define PATH(file) #file
  845. X# define DFILE(fl)    PATH(Data/) #fl
  846. X#else
  847. X# define PATH(file)    "/usr/net/games/lib/GB/file"
  848. X# define DFILE(fl)    "/usr/net/games/lib/GB/Data/fl"
  849. X#endif
  850. X
  851. X#define PATHLEN        200    /* length of file paths to the game.. */
  852. X
  853. X#define CUTE_MESSAGE    "\nThe Galactic News\n\n"
  854. X#define TELEGRAM    0
  855. X#define DECLARATION    1
  856. X#define TRANSFER    2
  857. X#define COMBAT        3
  858. X#define ANNOUNCE    4
  859. X
  860. X#define PAGER        Files[0]
  861. X#define DATADIR        Files[1]
  862. X#define DOCS        Files[2]
  863. X#define EXAM_FL        Files[3]
  864. X#define ENROLL_FL    Files[4]
  865. X#define DO_TURN        Files[5]
  866. X#define STARDATAFL     Files[6]
  867. X#define SECTORDATAFL     Files[7]
  868. X#define PLANETDATAFL     Files[8]
  869. X#define RACEDATAFL     Files[9]
  870. X#define BLOCKDATAFL    Files[10]
  871. X#define SHIPDATAFL     Files[11]
  872. X#define SHIPFREEDATAFL     Files[12]
  873. X#define DUMMYFL        Files[13]
  874. X#define PLAYERDATAFL     Files[14]
  875. X#define TELEGRAMDIR     Files[15]
  876. X#define TELEGRAMFL     Files[16]
  877. X#define POWFL        Files[17]
  878. X#define LOCK_ALL     Files[18]
  879. X#define NEWSDIR        Files[19]
  880. X#define DECLARATIONFL    Files[20]
  881. X#define TRANSFERFL    Files[21]
  882. X#define COMBATFL    Files[22]
  883. X#define ANNOUNCEFL    Files[23]
  884. X
  885. X#define PLANETLIST    "planet.list"
  886. X
  887. X#define PROFDATAFL    PATH(spitup)
  888. X#define DAEMONFL     PATH(daemon.dat)
  889. X
  890. Xextern char *Files[];
  891. X#endif
  892. END_OF_FILE
  893. if test 1475 -ne `wc -c <'server/files.h'`; then
  894.     echo shar: \"'server/files.h'\" unpacked with wrong size!
  895. fi
  896. # end of 'server/files.h'
  897. if test -f 'server/interface.h' -a "${1}" != "-c" ; then 
  898.   echo shar: Renaming existing file \"'server/interface.h'\" to \"'server/interface.h.orig'\"
  899.   mv -f 'server/interface.h' 'server/interface.h.orig'
  900. fi
  901. echo shar: Extracting \"'server/interface.h'\" \(443 characters\)
  902. sed "s/^X//" >'server/interface.h' <<'END_OF_FILE'
  903. X#include "TinyMUD_copyright.h"
  904. X
  905. X/* these symbols must be defined by the interface */
  906. Xextern int notify();
  907. Xextern int shutdown_flag; /* if non-zero, interface should shut down */
  908. Xextern void emergency_shutdown();
  909. X
  910. X/* the following symbols are provided by game.c */
  911. X
  912. X/* max length of command argument to process_command */
  913. X#define MAX_COMMAND_LEN 512
  914. X#define BUFFER_LEN ((MAX_COMMAND_LEN)*8)
  915. Xextern void process_command();
  916. X
  917. Xextern void panic();
  918. END_OF_FILE
  919. if test 443 -ne `wc -c <'server/interface.h'`; then
  920.     echo shar: \"'server/interface.h'\" unpacked with wrong size!
  921. fi
  922. # end of 'server/interface.h'
  923. if test -f 'server/power.c' -a "${1}" != "-c" ; then 
  924.   echo shar: Renaming existing file \"'server/power.c'\" to \"'server/power.c.orig'\"
  925.   mv -f 'server/power.c' 'server/power.c.orig'
  926. fi
  927. echo shar: Extracting \"'server/power.c'\" \(4434 characters\)
  928. sed "s/^X//" >'server/power.c' <<'END_OF_FILE'
  929. X/*
  930. X * Galactic Bloodshed, copyright (c) 1989 by Robert P. Chansky, 
  931. X * smq@ucscb.ucsc.edu, mods by people in GB_copyright.h.
  932. X * Restrictions in GB_copyright.h.
  933. X *
  934. X * Galactic Bloodshed (Robert Chansky, smq@ucscb.ucsc.edu)
  935. X * power.c -- display power report
  936. X */
  937. X
  938. X#include "GB_copyright.h"
  939. X#define EXTERN extern
  940. X#include "vars.h"
  941. X#include "races.h"
  942. X#include "power.h"
  943. X#include "buffers.h"
  944. X#include <errno.h>
  945. X#include <time.h>
  946. Xextern int errno;
  947. Xextern struct tm *update_tm;
  948. Xint power_racedata;
  949. X
  950. Xblock(Playernum,APcount, argn,args)
  951. Xint Playernum;
  952. Xint APcount, argn;
  953. Xchar args[MAXARGS][COMMANDSIZE];
  954. X{
  955. Xregister int i,n;
  956. Xint power_fd, p;
  957. Xracetype *r;
  958. Xint dummy;
  959. X
  960. X      n = Numraces();
  961. X
  962. Xif(argn > 1) {
  963. X
  964. X    GetPlayer(args[1], &p, &r);
  965. Xif(p < 1 || p > n) {
  966. X    notify(Playernum, "No such player,\n");
  967. X    return;
  968. X    }
  969. Xfree(r);
  970. X
  971. X/* list the players who are in this alliance block */
  972. X    dummy=(Blocks[p-1].invite & Blocks[p-1].pledge);
  973. X
  974. X sprintf(buf,"         ========== %s Power Report ==========\n",
  975. X            Blocks[p-1].name);
  976. X    notify(Playernum, buf);
  977. X sprintf(buf,"                    %-64.64s\n",
  978. X                Blocks[p-1].motto);
  979. X    notify(Playernum, buf);
  980. X  sprintf(buf," #  Name               sects   popn eff mob #shp #plan    res   fuel   dest\n");
  981. X    notify(Playernum, buf);
  982. X
  983. Xopenracedata(&power_racedata);
  984. Xfor(i=1; i<=n; i++)
  985. X    if(isset(dummy, i)) {
  986. X          getrace(power_racedata, &r,(int)i);
  987. X          if(!r->dissolved) {
  988. X          sprintf(buf,"%2d %-20.20s%5u%7u%4.0f%4.0f%5u%6u%7u%7u%7u\n",
  989. X            i, r->name,
  990. X            Power[i-1].sectors_owned, Power[i-1].popn, 
  991. X            Power[i-1].sectors_owned ? 
  992. X                (float)Power[i-1].sum_eff/Power[i-1].sectors_owned : 0.0,
  993. X            Power[i-1].sectors_owned ? 
  994. X                (float)Power[i-1].sum_mob/Power[i-1].sectors_owned : 0.0,
  995. X            Power[i-1].ships_owned, Power[i-1].planets_owned,
  996. X            Power[i-1].resource, Power[i-1].fuel, Power[i-1].destruct);
  997. X    notify(Playernum, buf);
  998. X          }
  999. X          free(r);
  1000. X        }
  1001. Xclose_file(power_racedata);
  1002. X
  1003. X    } else {   /* list power report for all the alliance blocks (as of the last update) */
  1004. X sprintf(buf,"         ========== Alliance Blocks as of %s ==========\n",
  1005. X            Power_blocks.time);
  1006. X    notify(Playernum, buf);
  1007. X  sprintf(buf," #  Name          members  sects    popn ship systems  res   fuel   dest   VPs\n");
  1008. X    notify(Playernum, buf);
  1009. Xfor(i=1; i<=n; i++)
  1010. X    if(Blocks[i-1].VPs) {
  1011. X          sprintf(buf,"%2d %-19.19s%3d%7u%8u%5u%6u%7u%7u%7u%6u\n",
  1012. X            i, Blocks[i-1].name, Power_blocks.members[i-1],
  1013. X            Power_blocks.sectors_owned[i-1], Power_blocks.popn[i-1], 
  1014. X            Power_blocks.ships_owned[i-1], Power_blocks.systems_owned[i-1],
  1015. X            Power_blocks.resource[i-1], Power_blocks.fuel[i-1],
  1016. X            Power_blocks.destruct[i-1], Power_blocks.VPs[i-1]);
  1017. X            notify(Playernum, buf);
  1018. X        }
  1019. X    }
  1020. X
  1021. X}
  1022. X
  1023. X
  1024. X
  1025. Xpower(Playernum,APcount, argn,args)
  1026. Xint Playernum;
  1027. Xint APcount, argn;
  1028. Xchar args[MAXARGS][COMMANDSIZE];
  1029. X{
  1030. Xregister int i,n;
  1031. Xint power_fd, p;
  1032. Xracetype *r, *Race;
  1033. X
  1034. Xn = Numraces();
  1035. Xp = -1;
  1036. X
  1037. Xif(argn>=2) {
  1038. X    GetPlayer(args[1], &p, &r);
  1039. Xif(p < 1 || p > n) {
  1040. X    notify(Playernum, "No such player,\n");
  1041. X    return;
  1042. X    }
  1043. X    free(r);
  1044. X    }
  1045. X
  1046. Xopenracedata(&power_racedata);
  1047. Xgetrace(power_racedata, &Race, Playernum);
  1048. X
  1049. X sprintf(buf,"         ========== Galactic Bloodshed Power Report ==========\n");
  1050. X    notify(Playernum, buf);
  1051. X  sprintf(buf," #  Name               sects   popn eff mob #shp  #plan   res   fuel   dest%s\n",
  1052. X        (Race->God ? " VNs" : ""));
  1053. X    notify(Playernum, buf);
  1054. X
  1055. X      for (i=1; i<=n; i++) 
  1056. X        if(argn < 2 || i==p) {
  1057. X          getrace(power_racedata, &r, (int)i);
  1058. X          if(!r->dissolved) {
  1059. X    if(Race->God)
  1060. X          sprintf(buf,"%2d %-20.20s%5u%7u%4.0f%4.0f%5u%6u%7u%7u%7u%4u\n",
  1061. X            i, r->name,
  1062. X            Power[i-1].sectors_owned, Power[i-1].popn, 
  1063. X            Power[i-1].sectors_owned ? 
  1064. X                (float)Power[i-1].sum_eff/Power[i-1].sectors_owned : 0.0,
  1065. X            Power[i-1].sectors_owned ? 
  1066. X                (float)Power[i-1].sum_mob/Power[i-1].sectors_owned : 0.0,
  1067. X            Power[i-1].ships_owned, Power[i-1].planets_owned,
  1068. X            Power[i-1].resource, Power[i-1].fuel, Power[i-1].destruct,
  1069. X            Sdata.VN_hitlist[i-1]);
  1070. X    else
  1071. X          sprintf(buf,"%2d %-20.20s%5u%7u%4.0f%4.0f%5u%6u%7u%7u%7u\n",
  1072. X            i, r->name,
  1073. X            Power[i-1].sectors_owned, Power[i-1].popn, 
  1074. X            Power[i-1].sectors_owned ? 
  1075. X                (float)Power[i-1].sum_eff/Power[i-1].sectors_owned : 0.0,
  1076. X            Power[i-1].sectors_owned ? 
  1077. X                (float)Power[i-1].sum_mob/Power[i-1].sectors_owned : 0.0,
  1078. X            Power[i-1].ships_owned, Power[i-1].planets_owned,
  1079. X            Power[i-1].resource, Power[i-1].fuel, Power[i-1].destruct);
  1080. X
  1081. X          notify(Playernum, buf);
  1082. X          }
  1083. X          free(r);
  1084. X      }
  1085. Xclose_file(power_racedata);
  1086. Xfree(Race);
  1087. X}
  1088. X
  1089. X
  1090. X
  1091. END_OF_FILE
  1092. if test 4434 -ne `wc -c <'server/power.c'`; then
  1093.     echo shar: \"'server/power.c'\" unpacked with wrong size!
  1094. fi
  1095. # end of 'server/power.c'
  1096. if test -f 'server/races.h' -a "${1}" != "-c" ; then 
  1097.   echo shar: Renaming existing file \"'server/races.h'\" to \"'server/races.h.orig'\"
  1098.   mv -f 'server/races.h' 'server/races.h.orig'
  1099. fi
  1100. echo shar: Extracting \"'server/races.h'\" \(2615 characters\)
  1101. sed "s/^X//" >'server/races.h' <<'END_OF_FILE'
  1102. X/*
  1103. X * Galactic Bloodshed, copyright (c) 1989 by Robert P. Chansky, 
  1104. X * smq@ucscb.ucsc.edu, mods by people in GB.c, enroll.dat.
  1105. X * Restrictions in GB.c.
  1106. X */
  1107. X
  1108. X
  1109. Xstruct race {
  1110. X    int Playernum;
  1111. X    char name[RNAMESIZE];
  1112. X    char motto[64];    /* for a cute message */
  1113. X    float tech;        /* technology */
  1114. X    float birthrate;
  1115. X    float overbirthrate;
  1116. X    percent fighters;
  1117. X    percent IQ;
  1118. X    percent number_sexes;
  1119. X    float mass;
  1120. X    float metabolism;
  1121. X    float adventurism;
  1122. X    short conditions[OTHER+1];    /* planetary conditions you like */
  1123. X    char deflevel;
  1124. X    char defsystem;
  1125. X    char defplanetnum;    /* current default */
  1126. X    char homelevel;
  1127. X    char homesystem;
  1128. X    char homeplanetnum;    /* home place */
  1129. X    float likes[DES_PLATED+1];        /* what territories they like */
  1130. X    char likesbest;
  1131. X    percent translate[MAXPLAYERS];    /* translation mod for each player */
  1132. X    percent captured_prisoners[MAXPLAYERS]; /* goes up with planetary contact */
  1133. X    unsigned int atwar;        /* war 32 bits*/
  1134. X    unsigned int allied;    /* allies 32 bits*/
  1135. X    unsigned short Gov_ship;
  1136. X
  1137. X    short gag;    /*options for toggle */
  1138. X    short double_digits;
  1139. X    short inverse;
  1140. X    short geography;
  1141. X    short autoload;
  1142. X    unsigned short highlight;    /* which race to highlight */
  1143. X    
  1144. X    short C_C;    /* berserker control code */
  1145. X    short standby;
  1146. X
  1147. X    short color;    /* whether or not you are using a color client */
  1148. X    short dissolved;
  1149. X    short weekly;    /* weekly allocation time */
  1150. X    short daily;    /* active time left over for the day */
  1151. X    short dummy4;
  1152. X
  1153. X    short God;        /* whether or not the race has God status */
  1154. X    short Thing;
  1155. X
  1156. X};
  1157. X
  1158. Xstruct block {
  1159. X    int Playernum;
  1160. X    char name[RNAMESIZE];
  1161. X    char motto[64];
  1162. X    unsigned int invite;
  1163. X    unsigned int pledge;
  1164. X    unsigned int atwar;
  1165. X    unsigned int allied;
  1166. X    unsigned short next;
  1167. X    unsigned short systems_owned;
  1168. X    unsigned VPs;
  1169. X
  1170. X    unsigned dummy;
  1171. X    unsigned dummy1;
  1172. X    unsigned dummy2;
  1173. X
  1174. X};
  1175. X
  1176. Xstruct power_blocks {
  1177. X    char time[128];
  1178. X    unsigned members[MAXPLAYERS];
  1179. X    unsigned popn[MAXPLAYERS];    /* total population */
  1180. X    unsigned resource[MAXPLAYERS];    /* total resource in stock */
  1181. X    unsigned fuel[MAXPLAYERS];
  1182. X    unsigned destruct[MAXPLAYERS];    /* total dest in stock */
  1183. X    unsigned short ships_owned[MAXPLAYERS];    /* # of ships owned */
  1184. X    unsigned short systems_owned[MAXPLAYERS];
  1185. X    unsigned sectors_owned[MAXPLAYERS];
  1186. X    unsigned short VPs[MAXPLAYERS];
  1187. X
  1188. X    unsigned dummy;
  1189. X    unsigned dummy1;
  1190. X    };
  1191. X
  1192. Xtypedef struct race racetype;
  1193. Xtypedef struct block blocktype;
  1194. XEXTERN struct block Blocks[MAXPLAYERS];
  1195. XEXTERN struct power_blocks Power_blocks;
  1196. XEXTERN int Block_start;
  1197. X
  1198. XEXTERN racetype *races[MAXPLAYERS];
  1199. END_OF_FILE
  1200. if test 2615 -ne `wc -c <'server/races.h'`; then
  1201.     echo shar: \"'server/races.h'\" unpacked with wrong size!
  1202. fi
  1203. # end of 'server/races.h'
  1204. if test -f 'server/relation.c' -a "${1}" != "-c" ; then 
  1205.   echo shar: Renaming existing file \"'server/relation.c'\" to \"'server/relation.c.orig'\"
  1206.   mv -f 'server/relation.c' 'server/relation.c.orig'
  1207. fi
  1208. echo shar: Extracting \"'server/relation.c'\" \(1807 characters\)
  1209. sed "s/^X//" >'server/relation.c' <<'END_OF_FILE'
  1210. X/* 
  1211. X * Galactic Bloodshed, copyright (c) 1989 by Robert P. Chansky, 
  1212. X * smq@ucscb.ucsc.edu, mods by people in GB_copyright.h.
  1213. X * Restrictions in GB_copyright.h.
  1214. X *
  1215. X * relation.c -- state relations among players 
  1216. X */
  1217. X
  1218. X#include "GB_copyright.h"
  1219. X#define EXTERN extern
  1220. X#include "vars.h"
  1221. X#include "races.h"
  1222. X#include "ships.h"
  1223. X#include "buffers.h"
  1224. X
  1225. Xextern char *Desnames[];
  1226. Xchar *allied();
  1227. Xint relation_racedata;
  1228. X
  1229. Xrelation(Playernum,APcount, argn, args)
  1230. Xint Playernum;
  1231. Xint APcount, argn;
  1232. Xchar args[MAXARGS][COMMANDSIZE];
  1233. X{
  1234. Xint numraces;
  1235. Xint p, q;
  1236. Xracetype *r, *Race;
  1237. X
  1238. X     numraces = Numraces();
  1239. X
  1240. Xif(argn==1) {
  1241. X    q = Playernum;
  1242. X} else {
  1243. X    GetPlayer(args[1], &q, &Race);
  1244. X        if(q < 1 || q > numraces) {
  1245. X            notify(Playernum, "No such player.\n");
  1246. X            return;
  1247. X            }
  1248. X}
  1249. X
  1250. Xopenracedata(&relation_racedata);
  1251. Xif(argn==1) getrace(relation_racedata, &Race, q);
  1252. X
  1253. X
  1254. X    sprintf(buf,"\n              Racial Relations Report for %s\n\n",Race->name);
  1255. X        notify(Playernum, buf);
  1256. X    sprintf(buf," #      know             Race name       Yours        Theirs \n");
  1257. X        notify(Playernum, buf);
  1258. X    sprintf(buf," -      ----             ---------       -----        ------ \n");
  1259. X        notify(Playernum, buf);
  1260. Xfor (p=1; p<=numraces; p++)
  1261. X        if (p != Race->Playernum) {
  1262. X            getrace(relation_racedata, &r, (int)p);
  1263. X            sprintf(buf,"%2d %s (%3d%%) %20.20s : %10s   %10s\n", p, 
  1264. X                  ((Race->God || Race->translate[p-1] > 30) && r->Thing) ? 
  1265. X                "Meso" : "    ", Race->translate[p-1], r->name,
  1266. X                allied(Race, p, 100, Race->God), 
  1267. X                    allied(r, q,Race->translate[p-1], Race->God) );
  1268. X        notify(Playernum, buf);
  1269. X            free(r);
  1270. X            }
  1271. Xfree(Race);
  1272. Xclose_file(relation_racedata);
  1273. X
  1274. X
  1275. X}
  1276. X
  1277. X
  1278. X
  1279. Xchar *allied(r, p, q, God)
  1280. Xracetype *r;
  1281. Xint p,q,God;
  1282. X{
  1283. X     if (isset( r->atwar, p)) return "WAR";
  1284. X     else if (isset( r->allied, p)) return "ALLIED";
  1285. X     else return "neutral";
  1286. X}
  1287. X
  1288. X
  1289. X
  1290. X
  1291. END_OF_FILE
  1292. if test 1807 -ne `wc -c <'server/relation.c'`; then
  1293.     echo shar: \"'server/relation.c'\" unpacked with wrong size!
  1294. fi
  1295. # end of 'server/relation.c'
  1296. if test -f 'server/shipdata.h' -a "${1}" != "-c" ; then 
  1297.   echo shar: Renaming existing file \"'server/shipdata.h'\" to \"'server/shipdata.h.orig'\"
  1298.   mv -f 'server/shipdata.h' 'server/shipdata.h.orig'
  1299. fi
  1300. echo shar: Extracting \"'server/shipdata.h'\" \(4424 characters\)
  1301. sed "s/^X//" >'server/shipdata.h' <<'END_OF_FILE'
  1302. X/*
  1303. X * Galactic Bloodshed, copyright (c) 1989 by Robert P. Chansky, 
  1304. X * smq@ucscb.ucsc.edu, mods by people in GB.c, enroll.dat.
  1305. X * Restrictions in GB.c.
  1306. X */
  1307. X
  1308. Xchar Shipltrs[]={ 'p','s','X','D','B','I','C','d','f','e','H','S','O','c',
  1309. X    't','!','+','m',
  1310. X    '=','\\','-','a','g','v','V','Q','L','w',':','G','F',
  1311. X    'T','&','A','[','R','P'};
  1312. X
  1313. Xint Shipdata[NUMSTYPES][NUMABILS] = {
  1314. X   /*  carg  dest guns fuelcap  tech crw arm cst  jmp lnd sw sp dm bd cn mod las prg*/
  1315. X/*SPd*/   1,    1,   0,     20,    1,  1,  0,  10,  0, 1, 0, 2,  0, 0, 0, 0, 0,  1,
  1316. X/*Shu*/  25,    2,   1,     20,   10,  5,  0,  40,  0, 1, 0, 4,  0, 3, 2, 1, 0, 1,
  1317. X/*Car*/ 600,  800,  30,   1000,  250, 60,  5, 700,  1, 0, 0, 4, 50, 2, 1, 1, 1, 1,
  1318. X/*Drn*/ 500,  500,  60,    500,  500, 40, 10,1000,  1, 1, 0, 6, 50, 3, 1, 1, 1, 1,
  1319. X/*BB */ 235,  400,  30,    200,  200, 30,  7, 400,  1, 1, 0, 6, 50, 3, 1, 1, 1, 1,
  1320. X/*Int*/ 110,  120,  30,    200,  200, 10,  2, 300,  1, 1, 0, 6, 50, 3, 1, 1, 1, 1,
  1321. X/*CA */ 165,  300,  20,    120,  150, 20,  5, 200,  1, 1, 0, 6, 50, 3, 1, 1, 1, 1,
  1322. X/*DD */ 110,  120,  15,     80,  100, 10,  3, 100,  1, 1, 0, 6, 50, 3, 1, 1, 1, 1,
  1323. X/*FF */   0,   40,  20,      8,  100,  1,  0,  40,  1, 1, 0, 6,  0, 3, 1, 1, 1, 1,
  1324. X/*Exp*/   0,    15,  5,     35,   20,  2,  1,  40,  1, 1, 0, 6,  0, 3, 0, 1, 1, 1,
  1325. X/*Hab*/5000,   500, 20,   2000,  100,2000, 3,1000,  1, 0, 0, 4, 75, 2, 2, 0, 1, 1,
  1326. X/*Stn*/5000,   250, 20,   2000,  100, 50,  1, 400,  1, 0, 0, 4, 75, 2, 2, 0, 1, 1,
  1327. X/*OSP*/1400,  1000, 50,   2000,  200,200,  5,1600,  1, 0, 0, 4, 75, 2, 2, 1, 1, 1,
  1328. X/*Crg*/1000,  1000, 10,   1000,  100,100,  2, 100,  1, 1, 0, 4,  0, 3, 2, 1, 0, 1,
  1329. X/*Tnk*/ 200,   200, 10,   5000,  100, 10,  2, 100,  1, 1, 0, 4,  0, 3, 1, 1, 0, 1,
  1330. X/*GOD*/20000,20000,20000,20000, 5000,100, 10, 100,  1, 1, 0, 9,  0, 0, 2, 1, 1, 1,
  1331. X/*SMn*/   0,    50,  0,     20,   50,  0,  1,  25,  0, 1, 1, 4,  0, 1, 0, 0, 0, 1,
  1332. X   /*  carg   dest guns fuelcap tech crw arm  cst jmp lnd sw sp  dm bd cn mod prg*/
  1333. X/*mir*/ 200,    10,  1,     20,  100,  5,  0, 200,  0, 0, 0, 2, 75, 2, 0, 0, 0, 1,
  1334. X/*Stc*/   0,     0,  0,     20,   50,  2,  0,  50,  1, 1, 0, 4,  0, 3, 0, 1, 0, 1,
  1335. X/*Tsc*/   0,     0,  0,      0,    5,  2,  0,  10,  0, 1, 0, 0,  0, 0, 0, 0, 0, 1,
  1336. X/*T-R*/   0,     0,  0,   1000,  100,  5,  0, 400,  0, 1, 1, 2,  0, 0, 0, 0, 0, 1,
  1337. X/*APr*/   0,     0,  0,    200,   50, 10,  1,  80,  0, 1, 1, 0,  0, 0, 0, 0, 0, 1,
  1338. X/*CD */   0,     1,  0,      1,   40,  0,  0,  20,  0, 1, 0, 2,  0, 0, 0, 0, 0, 1,
  1339. X/*VN */  20,     1,  0,     50,   80,  0,  1,  30,  0, 1, 1, 2,  0, 0, 0, 0, 0, 1,
  1340. X/*Bers*/ 50,   500, 40,   1000,10000,  0, 10, 100,  0, 1, 1, 4,  0, 0, 0, 0, 0, 1,
  1341. X/*Gov*/ 500,   100, 20,   1000,    0, 10, 20,1500,  1, 1, 0, 2, 75, 0, 0, 0, 0, 1,
  1342. X/*OMCL*/  0,   100, 10,    100,  350,  2,  1, 100,  0, 1, 1, 4,  0, 0, 0, 0, 0, 1,
  1343. X/*TWC*/   0,     1,  0,     20,   25,  0,  0,  10,  0, 1, 0, 2,  0, 0, 0, 0, 0, 1,
  1344. X/*Prb*/   0,     1,  0,     20,  200,  0,  0,  40,  1, 1, 0, 9,  0, 1, 0, 0, 0, 1,
  1345. X   /*  carg   dest guns fuelcap tech crw arm cst jmp ln sw sp  dm bd  cn mod prg*/
  1346. X/*GRL */ 50,   120, 40,      0,  100,  5,  3, 100,  0, 1, 0, 0, 50, 0, 0, 0, 0, 1,
  1347. X/*Fac*/   0,    0,   0,      0,    0, 20,  5,  50,  0, 1, 1, 0, 75, 0, 3, 0, 0, 1,
  1348. X/*TFD*/   0,     0,  0,    200,   70, 20,  1, 200,  1, 1, 1, 4,  0, 0, 0, 0, 0, 1,
  1349. X/*BCC*/ 200,    50,  5,      0,99999,  0, 10,   3,  0, 1, 1, 0,  0, 0, 0, 0, 0, 0,
  1350. X/*BAf*/1000,  1000,  0,   1000,99999,  0, 10,   8,  0, 1, 1, 0,  0, 0, 0, 0, 0, 0,
  1351. X/*TD */1000,  1000,  0,   1000,  400,100,  0,1200,  0, 1, 1, 0,  0, 0, 0, 0, 0, 1,
  1352. X/*SRp*/   0,     0,  0,      0,  100,  0,  0,  10,  0, 1, 0, 0,  0, 0, 0, 0, 0, 0,
  1353. X/*PDN*/   0,   500, 20,      0,  200, 50,  20, 500, 0, 1, 0, 0, 75, 0, 0, 0, 0, 1
  1354. X};
  1355. X
  1356. Xchar *Shipnames[NUMSTYPES] = {
  1357. X   "Spore pod",
  1358. X   "Shuttle",
  1359. X   "Carrier",
  1360. X   "Dreadnaught",
  1361. X   "Battleship",
  1362. X   "Interceptor",
  1363. X   "Cruiser",
  1364. X   "Destroyer",
  1365. X   "Fighter Group",
  1366. X   "Explorer",
  1367. X   "Habitat",
  1368. X   "Station",
  1369. X   "Ob Asst Pltfrm",
  1370. X   "Cargo Ship",
  1371. X   "Tanker",
  1372. X   "GODSHIP",
  1373. X   "Space Mine",
  1374. X   "Space Mirror",
  1375. X   "Space Telescope",
  1376. X   "Ground Telescope",
  1377. X   "* T-R beam",
  1378. X   "Atmosph Processor",
  1379. X   "Canister of dust",
  1380. X   "V.Neumann Machine",
  1381. X   "Berserker",
  1382. X   "Govrnmnt. Center",
  1383. X   "Mind Control Lsr",
  1384. X   "Tox Waste Canistr",
  1385. X   "Space Probe",
  1386. X   "Gamma Ray Laser",
  1387. X   "Factory",
  1388. X   "Terraform Device",
  1389. X   "Bers Cntrl Center",
  1390. X   "Bers Autofac",
  1391. X   "AVPM Transporter",
  1392. X   "Sector Repair",
  1393. X   "Planet Def Net"
  1394. X};
  1395. END_OF_FILE
  1396. if test 4424 -ne `wc -c <'server/shipdata.h'`; then
  1397.     echo shar: \"'server/shipdata.h'\" unpacked with wrong size!
  1398. fi
  1399. # end of 'server/shipdata.h'
  1400. if test -f 'server/tech.c' -a "${1}" != "-c" ; then 
  1401.   echo shar: Renaming existing file \"'server/tech.c'\" to \"'server/tech.c.orig'\"
  1402.   mv -f 'server/tech.c' 'server/tech.c.orig'
  1403. fi
  1404. echo shar: Extracting \"'server/tech.c'\" \(2001 characters\)
  1405. sed "s/^X//" >'server/tech.c' <<'END_OF_FILE'
  1406. X/*
  1407. X * Galactic Bloodshed, copyright (c) 1989 by Robert P. Chansky, 
  1408. X * smq@ucscb.ucsc.edu, mods by people in GB_copyright.h.
  1409. X * Restrictions in GB_copyright.h.
  1410. X *
  1411. X * tech.c -- increase investment in technological development.
  1412. X */
  1413. X
  1414. X#include "GB_copyright.h"
  1415. X#define EXTERN extern
  1416. X#include "vars.h"
  1417. X#include "races.h"
  1418. X#include "buffers.h"
  1419. X#include <math.h>
  1420. X#include <signal.h>
  1421. X#include <ctype.h>
  1422. Xint tech_pdata;
  1423. X
  1424. Xtechnology(Playernum,APcount, argn, args)
  1425. Xint Playernum;
  1426. Xint APcount, argn;
  1427. Xchar args[MAXARGS][COMMANDSIZE];
  1428. X{
  1429. Xint c,invest;
  1430. Xplanettype *p;
  1431. Xfloat tech_prod();
  1432. X
  1433. Xtech_pdata = NEUTRAL_FD;
  1434. X
  1435. Xif (Dir[Playernum-1].level != LEVEL_PLAN) {
  1436. X    sprintf(buf,"scope must be a planet (%d).\n", Dir[Playernum-1].level);
  1437. X        notify(Playernum, buf);
  1438. X    return;
  1439. X}
  1440. Xif (!enufAP(Playernum,Stars[Dir[Playernum-1].snum]->AP[Playernum-1], APcount)) {
  1441. X    return;
  1442. X    }
  1443. X
  1444. X openpdata(&tech_pdata);
  1445. X getplanet(tech_pdata,&p,Stars[Dir[Playernum-1].snum]->planetpos[Dir[Playernum-1].pnum]);
  1446. Xclose_file(tech_pdata);
  1447. X
  1448. Xif(argn < 2) {
  1449. X    sprintf(buf, "Current investment : %d    Technology production/update: %.3f\n",
  1450. X        p->info[Playernum-1].tech_invest,
  1451. X        tech_prod((int)p->info[Playernum-1].tech_invest,
  1452. X              (int)p->info[Playernum-1].popn));
  1453. X    notify(Playernum, buf);
  1454. X    free(p);
  1455. X    return;
  1456. X        }
  1457. X
  1458. X     invest=atoi(args[1]);
  1459. X
  1460. X    if (invest < 0) {
  1461. X        sprintf(buf,"Illegal value.\n");
  1462. X            notify(Playernum, buf);
  1463. X        free(p);
  1464. X        return;
  1465. X    }
  1466. X
  1467. Xp->info[Playernum-1].tech_invest = invest;
  1468. Xopenpdata(&tech_pdata);
  1469. Xputplanet(tech_pdata,p,Stars[Dir[Playernum-1].snum]->planetpos[Dir[Playernum-1].pnum]);
  1470. X close_file(tech_pdata);
  1471. X
  1472. X    deductAPs(Playernum,APcount, Dir[Playernum-1].snum, 0);
  1473. X
  1474. X    sprintf(buf,"   New (ideal) tech production: %.3f (this planet)\n", 
  1475. X            tech_prod((int)p->info[Playernum-1].tech_invest,
  1476. X                  (int)p->info[Playernum-1].popn));
  1477. X    notify(Playernum, buf);
  1478. X
  1479. X
  1480. X free(p);
  1481. X
  1482. X}
  1483. X
  1484. Xfloat tech_prod(investment, popn)
  1485. Xint investment;
  1486. Xint popn;
  1487. X{
  1488. Xfloat factor, scale;
  1489. X
  1490. Xscale = (float)popn/1000.;
  1491. X
  1492. Xreturn (TECH_INVEST * sqrt( (float)investment * scale));
  1493. X}
  1494. X
  1495. X
  1496. END_OF_FILE
  1497. if test 2001 -ne `wc -c <'server/tech.c'`; then
  1498.     echo shar: \"'server/tech.c'\" unpacked with wrong size!
  1499. fi
  1500. # end of 'server/tech.c'
  1501. if test -f 'server/toggle.c' -a "${1}" != "-c" ; then 
  1502.   echo shar: Renaming existing file \"'server/toggle.c'\" to \"'server/toggle.c.orig'\"
  1503.   mv -f 'server/toggle.c' 'server/toggle.c.orig'
  1504. fi
  1505. echo shar: Extracting \"'server/toggle.c'\" \(2668 characters\)
  1506. sed "s/^X//" >'server/toggle.c' <<'END_OF_FILE'
  1507. X/*
  1508. X * Galactic Bloodshed, copyright (c) 1989 by Robert P. Chansky, 
  1509. X * smq@ucscb.ucsc.edu, mods by people in GB_copyright.h.
  1510. X * Restrictions in GB_copyright.h.
  1511. X *
  1512. X *  toggle.c -- toggles some options
  1513. X */
  1514. X
  1515. X#include "GB_copyright.h"
  1516. X#define EXTERN extern
  1517. X#include "vars.h"
  1518. X#include "races.h"
  1519. X#include "buffers.h"
  1520. X#include <strings.h>
  1521. Xint toggle_racedata;
  1522. X
  1523. Xtoggle(Playernum,APcount, argn, args)
  1524. Xint Playernum;
  1525. Xint APcount;
  1526. Xint argn;
  1527. Xchar args[MAXARGS][COMMANDSIZE];
  1528. X{
  1529. Xint i;
  1530. Xracetype *Race;
  1531. X
  1532. X    openracedata(&toggle_racedata);
  1533. X    getrace(toggle_racedata, &Race, Playernum);
  1534. X    close_file(toggle_racedata);
  1535. X
  1536. X   if (argn>1) {
  1537. X    i = strlen(args[1]);
  1538. X
  1539. X    if (!strncmp(args[1],"inverse",i)) tog(Playernum,&Race->inverse,"inverse");
  1540. X    else if (!strncmp(args[1],"double_digits",i)) tog(Playernum,&Race->double_digits,
  1541. X                "double_digits");
  1542. X    else if (!strncmp(args[1],"geography",i)) tog(Playernum,&Race->geography,"geography");
  1543. X    else if (!strncmp(args[1],"gag",i)) tog(Playernum,&Race->gag,"gag");
  1544. X    else if (!strncmp(args[1],"autoload",i)) tog(Playernum,&Race->autoload,"autoload");
  1545. X    else if (!strncmp(args[1],"color",i)) tog(Playernum,&Race->color,"color");
  1546. X    else {
  1547. X        sprintf(buf,"No such option '%s'\n", args[1]);
  1548. X            notify(Playernum, buf);
  1549. X        free(Race);
  1550. X        return;
  1551. X        }
  1552. Xopenracedata(&toggle_racedata);
  1553. Xputrace(toggle_racedata, Race);
  1554. Xclose_file(toggle_racedata);
  1555. X
  1556. X   } else {
  1557. X    sprintf(buf,"gag is %s\n", Race->gag ? "ON" : "OFF");
  1558. X            notify(Playernum, buf);
  1559. X    sprintf(buf,"inverse is %s\n", Race->inverse ? "ON" : "OFF");
  1560. X            notify(Playernum, buf);
  1561. X    sprintf(buf,"double_digits is %s\n", Race->double_digits ? "ON" : "OFF");
  1562. X            notify(Playernum, buf);
  1563. X    sprintf(buf,"geography is %s\n", Race->geography ? "ON" : "OFF");
  1564. X            notify(Playernum, buf);
  1565. X    sprintf(buf,"autoload is %s\n", Race->autoload ? "ON": "OFF");
  1566. X            notify(Playernum, buf);
  1567. X    sprintf(buf,"color is %s\n", Race->color ? "ON": "OFF");
  1568. X            notify(Playernum, buf);
  1569. X    sprintf(buf, "highlight player %d\n", Race->highlight);
  1570. X            notify(Playernum, buf);
  1571. X   }
  1572. Xfree(Race);
  1573. X}
  1574. X
  1575. X
  1576. Xhighlight(Playernum, APcount, argn, args)
  1577. Xint Playernum;
  1578. Xint APcount;
  1579. Xint argn;
  1580. Xchar args[MAXARGS][COMMANDSIZE];
  1581. X{
  1582. Xint n;
  1583. Xracetype *alien, *Race;
  1584. X
  1585. XGetPlayer(args[1], &n, &alien);
  1586. X   if (n < 1 || n > Numraces() ) {
  1587. X    sprintf(buf,"No such player.\n");
  1588. X        notify(Playernum, buf);
  1589. X    return;
  1590. X   }
  1591. X
  1592. X      openracedata(&toggle_racedata); 
  1593. X      getrace(toggle_racedata, &Race, Playernum);    
  1594. X    Race->highlight = n;
  1595. X    putrace(toggle_racedata, Race);
  1596. X      close_file(toggle_racedata);
  1597. X    free(alien);
  1598. X    free(Race);
  1599. X    
  1600. X}
  1601. X
  1602. Xtog(Playernum,op, name)
  1603. Xint Playernum;
  1604. Xshort *op;
  1605. Xchar *name;
  1606. X{
  1607. X *op = !(*op);
  1608. X sprintf(buf, "%s is now %s\n", name, *op ? "on" : "off" );
  1609. X            notify(Playernum, buf);
  1610. X}
  1611. X
  1612. END_OF_FILE
  1613. if test 2668 -ne `wc -c <'server/toggle.c'`; then
  1614.     echo shar: \"'server/toggle.c'\" unpacked with wrong size!
  1615. fi
  1616. # end of 'server/toggle.c'
  1617. echo shar: End of archive 9 \(of 9\).
  1618. cp /dev/null ark9isdone
  1619. MISSING=""
  1620. for I in 1 2 3 4 5 6 7 8 9 ; do
  1621.     if test ! -f ark${I}isdone ; then
  1622.     MISSING="${MISSING} ${I}"
  1623.     fi
  1624. done
  1625. if test "${MISSING}" = "" ; then
  1626.     echo You have unpacked all 9 archives.
  1627.     rm -f ark[1-9]isdone ark[1-9][0-9]isdone
  1628. else
  1629.     echo You still need to unpack the following archives:
  1630.     echo "        " ${MISSING}
  1631. fi
  1632. ##  End of shell archive.
  1633. exit 0
  1634.